import CommonHeader from '@/components/CommonHeader'
import { IRouteComponentProps } from 'umi'
import { Layout } from 'antd'
import React from 'react';

import styles from './index.less'
import { GithubOutlined, WifiOutlined } from '@ant-design/icons';

const whiteList = ['/', '/archives', '/knowledge']
export default function GlobalLayout({ children, location, route, history, match }: IRouteComponentProps) {
  let body = children;
  if (whiteList.indexOf(location.pathname) !== -1) {
    body = <div className="container content">
      {children}
    </div>
  }

  return <Layout className={styles.layoutss}>
    <CommonHeader />
      <div className={styles.main}>
        {body}
      </div>
    <footer>
      <div className={styles.footer}>
        <ul>
          <li><WifiOutlined /></li>
          <li><GithubOutlined></GithubOutlined></li>
        </ul>
        <div>
          创作平台
        </div>
      </div>

    </footer>

  </Layout>
}
